package com.fa4j.system.login.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.ToString;

@Data
@Schema(description = "登录参数")
public class LoginCmd {

    @NotNull
    @Schema(description = "登录方式")
    private LoginType loginType;

    @NotBlank(groups = PwdLogin.class)
    @Schema(description = "登录名")
    private String loginName;

    @NotBlank(groups = PwdLogin.class)
    @Schema(description = "登录密码")
    @ToString.Exclude
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String loginPwd;

    @NotBlank(groups = {CodeLogin.class, SmsLogin.class})
    @Schema(description = "登录授权码")
    private String authCode;

    public interface PwdLogin {
    }

    public interface SmsLogin {
    }

    public interface CodeLogin {
    }

}
